import 'package:flutter/cupertino.dart';

///链式编程设置边距
class FFedge {
  double? leftValue;
  double? topValue;
  double? rightValue;
  double? bottomValue;

  ///最终调用这个
  EdgeInsets build() {
    return EdgeInsets.only(
      left: leftValue ?? 0,
      right: rightValue ?? 0,
      top: topValue ?? 0,
      bottom: bottomValue ?? 0,
    );
  }

  //左
  FFedge left(double l) {
    leftValue = l;
    return this;
  }

  //上
  FFedge top(double l) {
    topValue = l;
    return this;
  }

  //右
  FFedge right(double l) {
    rightValue = l;
    return this;
  }

  //下
  FFedge bottom(double l) {
    bottomValue = l;
    return this;
  }

  //左 右
  FFedge leftRight(double l) {
    leftValue = l;
    rightValue = l;
    return this;
  }

  //上 下
  FFedge topBottom(double l) {
    topValue = l;
    bottomValue = l;
    return this;
  }
}
